"""web URL Configuration

The `urlpatterns` list routes URLs to views. For more information please see:
    https://docs.djangoproject.com/en/1.11/topics/http/urls/
Examples:
Function views
    1. Add an import:  from my_app import views
    2. Add a URL to urlpatterns:  url(r'^$', views.home, name='home')
Class-based views
    1. Add an import:  from other_app.views import Home
    2. Add a URL to urlpatterns:  url(r'^$', Home.as_view(), name='home')
Including another URLconf
    1. Import the include() function: from django.conf.urls import url, include
    2. Add a URL to urlpatterns:  url(r'^blog/', include('blog.urls'))
"""
from django.conf.urls import url
from .views import views,typeviews,goodsviews,orderviews,mapviews

urlpatterns = [
    # 首页
    url(r'^$', views.index,name='index'),
    url(r'^login$', views.login,name="adminlogin"),
    url(r'^dologin$', views.dologin,name="admindologin"),
    url(r'^logout$', views.logout,name="adminlogout"),
    url(r'^verifycode$',views.verifycode,name='verifycode'),





    # 会员管理
    url(r'^userindex',views.userindex,name='userindex'),
    url(r'^useradd',views.useradd,name='useradd'),
    url(r'^admininsert',views.admininsert,name='admininsert'),
    url(r'^userdel/(?P<uid>[0-9]+)',views.userdel,name='userdel'),
    url(r'^useredit/(?P<uid>[0-9]+)',views.useredit,name='useredit'),
    url(r'^userupdate',views.userupdate,name='userupdate'),
    
    # 商品分类
    url(r'^typeindex',typeviews.typeindex,name='typeindex'),
    url(r'^typeadd',typeviews.typeadd,name='typeadd'),
    url(r'^typeinsert',typeviews.typeinsert,name='typeinsert'),
    url(r'^typedel/(?P<tid>[0-9]+)',typeviews.typedel,name='typedel'),
    url(r'^typeedit/(?P<tid>[0-9]+)',typeviews.typeedit,name='typeedit'),
    url(r'^typeupdate',typeviews.typeupdate,name='typeupdate'),


    # 商品列表
    url(r'^goodsindex',goodsviews.goodsindex,name='goodsindex'),
    url(r'^goodsadd',goodsviews.goodsadd,name='goodsadd'),
    url(r'^goodsinsert',goodsviews.goodsinsert,name='goodsinsert'),
    url(r'^goodsdel/(?P<gid>[0-9]+)',goodsviews.goodsdel,name='goodsdel'),
    url(r'^goodsedit/(?P<gid>[0-9]+)',goodsviews.goodsedit,name='goodsedit'),
    url(r'^goodsupdate',goodsviews.goodsupdate,name='goodsupdate'),

    # 订单管理
    url(r'^orderindex',orderviews.orderindex,name='orderindex'),
    url(r'^orderedit/(?P<oid>[0-9]+)',orderviews.orderedit,name='orderedit'),
    url(r'^orderupdate',orderviews.orderupdate,name='orderupdate'),


    # 轮播图管理
    url(r'^mapindex',mapviews.mapindex,name='mapindex'),
    url(r'^mapadd',mapviews.mapadd,name='mapadd'),
    url(r'^mapinsert',mapviews.mapinsert,name='mapinsert'),
    url(r'^mapdel/(?P<uid>[0-9]+)',mapviews.mapdel,name='mapdel'),
]
